/**
 * ClassName: AbstractTest
 * Package: PACKAGE_NAME
 * Description:
 *
 * @Author 蒋林康
 * @Create 2023/12/10 12:23
 * @Version 1.0
 */
public class AbstractTest {
    public static void main(String[] args) {

        //一旦Person类抽象了，就不可实例化
        //Person p1 = new Person();
        // p1.eat();
        Student s1 = new Student();
        s1.eat();
        s1.hashCode();
        s1.breath();

    }
}

abstract class Creature{
    public abstract void breath();
}

abstract class Person extends Creature{
    String name;
    int age;

    public Person(){

    }
    public Person(String name,int age){
        this.name = name;
        this.age = age;
    }

    //不是抽象方法：
//	public void eat(){
//
//	}
    //抽象方法
    public abstract void eat();

    public void walk(){
        System.out.println("人走路");
    }


}


class Student extends Person{

    public Student(String name,int age){
        super(name,age);
    }
    public Student(){
    }

    public void eat(){
        System.out.println("学生多吃有营养的食物");
    }

    @Override
    public void breath() {
        System.out.println("学生应该呼吸新鲜的没有雾霾的空气");
    }
}
